package com.mybatis;

import com.mybatis.mapper.CustomerMapper;
import com.mybatis.pojo.Customer;
import com.mybatis.utils.MyBatisUtils;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

import java.io.IOException;
import java.io.Reader;
import java.util.List;

public class customertest {
    public static void main(String[] args) {
        SqlSession sqlSession = MyBatisUtils.getSession();
        Customer customer = new Customer();
        customer.setUsername("joy");
        customer.setJobs("teacher");
        CustomerMapper customerMapper = sqlSession.getMapper(CustomerMapper.class);
        List<Customer> customers = customerMapper.findCustomerByNameAndJobs(customer);
        for (Customer customer1 : customers) {
            System.out.println(customer1);
        }
        sqlSession.close();
    }
}
